// unordered_set
// Created by FanGccU on 2025/6/23.
// 和 set 的区别：不会进行元素排序

#include <iostream>
#include <unordered_set>
using namespace std;

int main(int argc, char *argv[]) {
    unordered_set<int> us;

    // 向头部插入元素
    us.insert(10);
    us.insert(50);
    us.insert(30);
    us.insert(20);
    us.insert(40);

    cout << "value is :\t";
    for (int i: us) {
        cout << i << "\t";
    }
    cout << endl;

    if (us.find(60) != us.end()) {
        cout << "60 not exist" << endl;
    }

    // 移除
    us.erase(10);

    cout << "size:\t" << us.size() << endl;

    // 清除
    us.clear();

    cout << "size:\t" << us.size() << endl;
}
